#!/usr/bin/env python
# -*- coding:utf-8 -*-
from django.conf.urls import url
from rest_framework import routers

from .views import *
from rest_framework_jwt.views import obtain_jwt_token

urlpatterns = [
    url(r'^usernames/(?P<username>\w{5,20})/count/$', UsernameCountView.as_view()),
    url(r'^mobiles/(?P<mobile>1[3-9]\d{9})/count/$', MobileCountView.as_view()),
    url(r'^users/$', CreateUserView.as_view()),
    url(r'^authorizations/$', obtain_jwt_token),  # 登录认证
    url(r'^user/$', UserDetailView.as_view()),  # 获取个人信息
    url(r'^email/$', EmailView.as_view()),  # 设置邮箱
    url(r'^emails/verification/$', VerifyEmailView.as_view()),  # 验证邮箱
    url(r'^browse_histories/$', UserBrowsingHistoryView.as_view()),  # 浏览记录
]

router = routers.DefaultRouter()
router.register(r'addresses', AddressViewSet, base_name='addresses')
urlpatterns += router.urls
